import request from '@/utils/request'

/**
 * @description: 获取方案类别
 * @param {*} params
 */
export function getCheckOptionClassList(params) {
  return request({
    url: '/check/option/class',
    params
  })
}

/**
 * @description: 获取检验类别 巡检，全检
 * @param {*} params
 */
export function getCheckTypeList(params) {
  return request({
    url: '/check/option/type',
    params
  })
}

/**
 * @description: 新增检验方案
 * @param {*} data
 */
export function addCheckOption(data) {
  return request({
    url: '/check/option',
    method: 'post',
    data
  })
}

/**
 * @description: 更新检验方案
 * @param {*} data
 */
export function updateCheckOption(data) {
  return request({
    url: '/check/option',
    method: 'put',
    data
  })
}

/**
 * @description: 获取检验方案清单
 * @param {*} params
 */
export function getCheckOptionList(params) {
  return request({
    url: '/check/option',
    params
  })
}

/**
 * @description: 获取方案详情
 * @param {*} params
 */
export function getCheckOptionDetail(params) {
  return request({
    url: `/check/option/${params.optionID}`
  })
}

/**
 * @description: 删除检验方案
 * @param {*} data
 */
export function deleteCheckOption(data) {
  return request({
    url: '/check/option',
    method: 'delete',
    data
  })
}

/**
 * @description: 获取产品的检验方案
 * @param {*} params
 */
export function getProdCheckOption(params) {
  return request({
    url: '/prod/check/option',
    params
  })
}
